package com.starbugs.wehcat.service;

import com.starbugs.wehcat.pojo.User;
import com.starbugs.wehcat.data.UserRepository;
import org.springframework.data.domain.Example;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author starbooks
 */
@Service
public class UserServiceImpl implements UserService{

  @Autowired
  UserRepository userRepository;

  @Override
  public List<User> getAll(Example example) {
    List<User> users = userRepository.findAll();
    return users;
  }

  @Override
  public void saveUser(User user) {
    userRepository.save(user);
  }
}
